const { ccclass, property } = cc._decorator;
import TargetBase from './TargetBase';

@ccclass
export default class AnimEndDestroy extends cc.Component {
    @property
    anim: cc.Animation = null;
    _TargetBase: TargetBase = null;
    init() {
        this.anim = this.node.getComponent(cc.Animation);
        this.anim.on("finished", this.animEnd, this);
        this.anim.play();
    }
    animEnd() {
        this._TargetBase.deleteRefreshNode(-1, false, false, this.node);
    }
}
